package com.fanqiechaodan.mediator;

/**
 * @author fanqiechaodan
 * @Classname Demo
 * @Description 中介者模式
 */
public class Demo {

    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();
        ConcreteColleague1 concreteColleague1 = new ConcreteColleague1(mediator);
        ConcreteColleague2 concreteColleague2 = new ConcreteColleague2(mediator);
        mediator.setConcreteColleague1(concreteColleague1);
        mediator.setConcreteColleague2(concreteColleague2);
        concreteColleague1.send("Hello concreteColleague2");
        concreteColleague2.send("Hello concreteColleague1");
    }
}
